package bjtu.tjj.simpledy.controller;

import bjtu.tjj.simpledy.common.CommonResult;
import bjtu.tjj.simpledy.service.WatchService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("watch")
public class WatchController {
    private final WatchService watchService;

    @PostMapping("{videoId}")
    public CommonResult<Void> onWatch(@PathVariable Long videoId) {
        watchService.onWatch(videoId);
        return CommonResult.success();
    }
}
